<?php
/*
 * page to display gannt chart report asynchronously
*/ 
//check for a valid session
include("../inc_files/utils/checksession.php");
//include the page header
include("../inc_files/ui/header.php");?>
<title>Project Gannt Chart Report</title>
<script type="text/javascript" src="../scripts/async.js"></script>
<script type='text/javascript'>

//display the list of projects
function processddl(ddl){
	if(ddl.selectedIndex == 0){
		document.getElementById('datagrid').innerHTML = "";
	}  else {
		var projectid = ddl.options[ddl.selectedIndex].value;
		refreshgrid(projectid);
	}		
}

//refresh the gannt chart report for the selected project
function refreshgrid(projectid){
	var nochache = Math.floor(Math.random() * 10000);
	getasync('a_gannt.php?projectid=' + projectid + '&nocache=' + nochache,'datagrid', true);		
}

</script>
</head>
<body>
	<?php //add the navigation to the page
include("../inc_files/ui/menu.php");?>

	<table style="width: 100%; align: center">
		<tr>
			<td style="width: 100%; font-size: 10pt; color: black;"
				align="center">Please select a project:&nbsp;&nbsp; <select
				name="projectsddl" id="projectsddl" onchange="processddl(this)">
					<?php
					//create drop down list of projects which have not been deleted
					include("../inc_files/ui/projectsddl.php");
					?>
			</select>

			</td>
		</tr>

		<tr>
			<td align="center" style="position: relative; z-index: 1;">
				<!-- add a div tag to display the timesheets using AJAX -->
				<div id="datagrid"
					style="position: relative; z-index: 2; width: 100%; border: 1px solid #E0E0E0;"></div>


			</td>
		</tr>
	</table>
	<?php
	//add the page footer
	include("../inc_files/ui/footer.php");?>

</body>
</html>
